{include file="lib/header.html" type="login" title="用户登录" }
  <div id="container">
    <div class="login-box" style="margin-top:70px;">
      <div class="login-inner">
        <!-- <div class="bird"><img src="../images/bird.png" width="124" height="126"></div> -->
        <form action = "{AnUrl('user/login/check_login')}" id="btn_login_form" method="post">
        <div class="input-box">
          <div class="txt-box">
            <input type="hidden" name="logintype" value="login">
            <p class="txt-wrap1 clearfix"><input type="text" name="username" id="username" placeholder="用户名/邮箱/手机号" class="txt1"/><span class="prompt hidden" id="user_hint"><i class="false-icon"></i>用户名格式错误</span></p>
            <p class="txt-wrap1 clearfix"><input type="password" name="password" id="password" placeholder="密码" class="txt1"/><span class="prompt hidden" id="pass_hint"><i class="false-icon"></i>密码格式错误</span></p>
          </div>
          <p><a href="javascript:void(0);" id="btn_login" class="btn2 login-btn clearfix">立即登录</a></p>
          <p class="clearfix"><label class="label1"><input type="checkbox" name="memberpass" value="1"/>两周内自动登录</label><a href="{AnUrl('user/getback/get_back')}" class="forget-pwd">忘记密码</a></p>
          <p><a href="{AnUrl('user/register')}" class="btn1 register-btn clearfix">注册NBD账号</a></p>
          <p class="lx-login"><a href="{AnUrl('openapi/lenovo/index')}">联想通行证登录</a></p>
        </div>
        </form>
        <div class="other-login">
          <p class="tit"><span class="middle">合作账号登录</span></p>
          <div class="social">
            <a href="{AnUrl('openapi/sinaweibo/index')}" class="sina"></a>
            <a href="{AnUrl('openapi/qqconnect/login')}" class="qq"></a>
            <a href="{AnUrl('openapi/baiduconnect/login')}" class="baidu"></a>
            <a href="{AnUrl('openapi/weixin/web/login')}" class="weixin"></a>
          </div>
        </div>
      </div>
      {include_core file="lib/bottom_copy.html"}
    </div>
    <!--end login-box-->
  </div>
</div>
<script>
$(function(){
  $('#user_hint, #pass_hint').click(function(){
    $(this).hide();
  });
  $("#username, #password").keydown(function(e){ 
    var curKey = e.which; 
    if(curKey == 13){ 
    $("#btn_login").click(); 
    return false; 
    } 
    }); 
  
  $('#btn_login').click(function(){
    $('#btn_login').html('正在登录...');
    var username = $.trim($('#username').val());
    var password = $.trim($('#password').val());
    var iconHtml = '<i class="false-icon"></i>';
    if(username == '') {
      $('#user_hint').show().html(iconHtml + '用户名不能为空');
      $('#btn_login').html('立即登录');
      return;
    } 
    if(password == '') {
      $('#pass_hint').show().html(iconHtml + '密码不能为空');
      $('#btn_login').html('立即登录');
      return;
    }
    
    $.post(
        "{AnUrl('user/login/check_login')}",
        { "username" : username, "password":password },
        function(data){
          if(data.info == 'error') {
            if(data.type == 'user') {
              $('#user_hint').show().html(iconHtml + data.msg);
              $('#btn_login').html('立即登录');
              return;
            } else {
              $('#pass_hint').show().html(iconHtml + data.msg);
              $('#btn_login').html('立即登录');
              return;
            }
          } else {
            $('#btn_login_form').submit();
          }
        },'json');
    
  });
})
</script>
{include file="lib/footer.html"}